/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is COID coidgen tool.
 *
 * The Initial Developer of the Original Code is
 * PosAm.
 * Portions created by the Initial Developer are Copyright (C) 2003
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 * Robo Strycek
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */



#ifndef __STR_H
#define __STR_H





namespace coid {



struct NAME_FLAGS
{
	const char * name;
	uint flags;
	enum {fappend_name=1, ferror=2};
};



struct KEYWORDS
{
	const char * name;
	uint size;
	uint flags, flags_and;
};







char * str_trim( char * ptr );
char * replace_char( char * ptr, char c1, char c2 );

char * next_word( char * ptr );
char * prev_word( char * start, char * end );

const char * str2str( const char * src, const char * p1, const char * p2, uint size2 );
const char * str2chr( const char * src, char c1, char c2 );
char * str_count_chr( const char * src, char c1, char c2, int count );
int get_line_number( const char * p1, const char * p2 );

char * remove_word( char * string1, const char * string2 );
char * remove_part_of_string( char * start, const char * end );

char * read_file( const char * filename, uint * size=NULL );	/// uses new allocator









extern const char * STR_skip_args[];
extern const uint STR_skip_args_size;

extern const char * STR_client_functions[];
extern const uint STR_client_functions_size;

extern NAME_FLAGS STR_remove_types[];
extern const uint STR_remove_types_size;

extern KEYWORDS STR_templates[];
extern const uint STR_templates_size;

extern KEYWORDS STR_options[];
extern const uint STR_options_size;

extern KEYWORDS g_ARG_keywords[];
extern const uint g_ARG_keywords_size;

extern KEYWORDS STR_special_functions[];
extern const uint STR_special_functions_size;
extern const uint client_functions_public_count;




} // namespace coid




#endif	// ! __STR_H
